//console.log('str1:',str)

//  var能重复定义，let不能重复定义
let str = 'hello'
//let str = 'hello1111'
console.log('str2:', str)

//var没有块级作用域,let有块级作用域



if (true) { 
    var n = 1
   // let n2=100
}

console.log('n:',n)
//console.log('n2:',n2)

for (let i = 0; i < 5; i++) { 
    

}

//console.log('i:', i)
var index = 666
var username='jack'
function getName() { 
   username = '2104C'
    console.log('username内:',username)
    return username
}

//getName()

console.log('indexe外:',index)
console.log('username外:', username)

//let和const区别
let a = 10
a = 20
const a2 = {
    username:'jack',
}


a2.username='张磊'

console.log('a2:', a2.username)

//symbol
let s1 = Symbol('aa')
let s2= Symbol('aa')
console.log(s1 === s2)